Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add solc artifacts to known contracts for traces #572

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

nbaztec
Copy link
Collaborator

@nbaztec nbaztec commented Sep 13, 2024

Motivation

In zksync context, the traces cannot decode contracts via EVM bytecode as we only pass zksolc artifacts to known_contracts.

Traces:
  [1120167] 0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496::testFoo()
    ├─ [0] VM::zkVmSkip()
    │   └─ ← [Return] 

Additionally, invariant tests do not work with testContract as during the test, they perform the lookup on the target address and try to match it with a known contract to obtain the ABI for invariant testing. This being an EVM bytecode, the test always fails as we do not know of any solc artifacts within known_contracts.

Solution

Append solc artifacts to known_contracts. This is supported by the argument that in zksync context we are always aware of solc artifacts as we use them to translate bytecodes between VMs.

This therefore fixes the decode problem:

Traces:
  [1120167] FooTest::testFoo()
    ├─ [0] VM::zkVmSkip()
    │   └─ ← [Return] 

@nbaztec nbaztec changed the title feat: add solc artifacts to known contracts for traces fix: add solc artifacts to known contracts for traces Sep 13, 2024
@nbaztec nbaztec merged commit 25b306f into main Sep 13, 2024
11 checks passed
@nbaztec nbaztec deleted the nish-add-solc-known-contracts branch September 13, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants